package com.traval.goods.dao;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

import com.traval.goods.models.TGoods;
import com.traval.goods.models.TPlaneticket;
import com.traval.goods.models.TRoom;
import com.traval.goods.models.TTravalticket;
import com.traval.util.HibernateSessionFactory;
/*
 * 后台管理商品
 */
public class GoodsDaoImpl implements GoodsDao {

	TGoods goods;
	Transaction tx;
	@Override
	public TGoods addGoods(TPlaneticket planeticket,TRoom room,TTravalticket travalticket) {
		// TODO Auto-generated method stub
//		Session session = HibernateSessionFactory.getSession();
//		tx = session.beginTransaction();
//		goods = new TGoods();
//		goods.getTPlanetickets().add(travalticket);
//		goods.getTRooms().add(room);
//		goods.getTTravaltickets().add(travalticket);
//		session.save(goods);
//		tx.commit();
//		session.close();
		return goods;
	}

	@Override
	public void deleteGoods(TPlaneticket planeticket,TRoom room,TTravalticket travalticket) {
		// TODO Auto-generated method stub
	}

	@Override
	public TGoods updateGoods(TPlaneticket planeticket,TRoom room,TTravalticket travalticket) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void searchGoods() {
		// TODO Auto-generated method stub

	}

}
